my $sz=0x5C;
my $start=0x22;

while ($file=<*.rtp>)
{
	open IN,$file;
	binmode IN;
	sysread IN,$_,$start;

	open OUT,">$file.hdr";
	binmode OUT;
	syswrite OUT,$_;
	close OUT;

	while ($sz == sysread(IN,$_,$sz))
	{
		($s2,$name)=unpack "LA13",substr $_,20,4+13;
		open OUT,">$file.$name";
		binmode OUT;
		syswrite OUT,$_;
		sysread IN,$_,$s2;
		syswrite OUT,$_;
		close OUT;
	}
	close IN;	
}
